#include<iostream>
#include<string>
#include<map>
using namespace std;
string s1,s2,ans;
map<int,int>mp;
int main()
{
    getline(cin,s1);
	getline(cin,s2);
	for(auto x:s2){
		mp[x]=1;
	}
	for(auto x:s1){
		if(mp[x])continue;
		ans+=x;
	}
	cout<<ans<<endl;
	return 0;
}
